<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="Shortcut Icon" href="/static/ico.png" type="image/x-icon" />

    <title>中间页</title>

    <link href="/static/css/jump.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/canvas.css" rel="stylesheet" type="text/css" />
    <script>
      function getQueryParam(key) {
        const queryString = window.location.search;
        const urlParams = new URLSearchParams(queryString);
        return urlParams.get(key);
      }

      function handleVerification() {
        // 获取gt和challenge
        const gtValue = "<%= gt %>";
        const challengeValue = "<%= challenge %>";

        localStorage.setItem("gt", gtValue);
        localStorage.setItem("challenge", challengeValue);
        localStorage.setItem("e", getQueryParam('e'));
        

        window.location.replace(`${window.location.origin}/geetest`);
      }
    </script>
  </head>

  <body>
    <section class="canvas-wrap">
      <div class="canvas-content">
        <div id="canvas">
          <div class="box">
            <h2>跳转后请务必验证，不然这个验证码就失效了，需要重新获取</h2>
            <br /><br />
            <h4>如果您不验证请不要点击跳转!</h4>
            <div class="spacer"></div>
            <a
              href="javascript:void(0);"
              class="button"
              onclick="handleVerification()"
            >
              > 点击前往验证
            </a>
          </div>
          <footer id="footer">
            <p class="copyright">{{copyright}}</p>
          </footer>
        </div>
      </div>
    </section>

    <script src="/static/js/JoanClaret/three.min.js"></script>
    <script src="/static/js/JoanClaret/projector.js"></script>
    <script src="/static/js/JoanClaret/canvas-renderer.js"></script>
    <script src="/static/js//JoanClaret/3d-lines-animation.js"></script>
  </body>
</html>
